<template>
  <span v-if="dictOject.value === ''">{{ dictOject.label }}</span>
  <n-tag
    v-else-if="dictOject.listClass"
    :type="dictOject.listClass"
    >{{ dictOject.label }}</n-tag
  >
</template>

<script lang="ts" setup>
  import { type DictData } from '@/api/power/dict'
  const props = defineProps<{
    options: DictData[]
    value: string | number
  }>()

  const dictOject = computed(
    () => props.options.find(item => String(item.value) === String(props.value)) || {}
  )
</script>

<style scoped lang="scss"></style>
